-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix computed values to be computed after all set_options #690
Conversation
The new test fails before 7ed3c2c
Hi again @ulwlu! Great, thanks for this. I've pushed one commit to your branch adding a test that is intended to reproduce the bug that you are fixing. But there's one thing I'm confused about: My test fails on master and passes on your branch. However my test tests |
Hi @dandavison thank you for your review. This is bacause cli.rs set opt.true-color to 'auto' if '--true-color' option is not given. That is the default value given by struct-opt. I think it's little bit confusing, maybe we can remove the default value and change match condition inside set_true_color function. |
src/options/set.rs
Outdated
arg_matches, | ||
option_names, | ||
false | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true_color
is present in the main call to set_options!
on l.182. I think we need to know why that call is not working -- it feels wrong to make two set_options!
calls for true_color
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see, and sorry. I missed that and found opt.true_color
is set correctly (not exact correct because it's not computed into bool) from gitconfig after set_options. I'm maybe going to fix.
Thanks for explaining that! |
Thanks to your pointing out, I found some configurations which is to be computed depends on I'm going to think what way is good. |
Hi I fixed and change this PR's purpose.
I move
|
Awesome, thanks very much for these fixes @ulwlu. I did some manual testing to check that |
@dandavison thanks! Btw, integrating tig with delta is almost finished. Now I'm fixing little bugs. |
Awesome. Those screenshots look really nice. (I just tried compiling but got an error
) |
Umm, init_expanded_pair is only available with ncurse upper than version 6.1, so compiling option may get wrong (such as linking with different path). I also strrugled at that building. If this get merged jonas will release the new binary anyway, so maybe trying after that is easier... |
OK thanks (my Mac has 5.4, but I saw your instructions for building and linking against ncurses). |
* upstream/master: Refactor: use Option to model sometimes-null highlighter (dandavison#698) Add some test coverage for truncate_str with a multibyte unicode character Use "syntax theme" terminology in show-syntax-themes output (dandavison#697) Fix deadlock in `git diff` mode (dandavison#695) Fix empty line highlighting (dandavison#642) Revert "Add failing test that gitconfig insteadOf is honored" Add failing test that gitconfig insteadOf is honored Support `insteadOf` replacements in git remote URLs Hold GitConfig in main Config struct Revert "Support `insteadOf` replacements in git remote URLs" Support `insteadOf` replacements in git remote URLs Refactoring for dandavison#693 (dandavison#696) Make it possible to jump between files when navigate is active (dandavison#684) Bump dev version number Compile delta from source in dockerfile Fix computed values to be computed after all set_options (dandavison#690) Remove unnecessary borrows (dandavison#692) Bump bitflags from 1.3.1 to 1.3.2 (dandavison#691) Bump git2 from 0.13.20 to 0.13.21 (dandavison#687)
What this pr does
How it was
It was not working from original source.
So I make it works.
This still give prior to the config from cli. Also 24-bit-color can still work.
Motivaiton
I'm trying to integrate delta inside tig.
#689
However, if you allow user to use RGB, it's almost impossible inside tig since it uses ncurses. So I'm trying to limit only 8bit colors. Then I found this bug.